﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace QuakeStats
{
    class TeamScoreEntry : LogEntry
    {
        public TeamScoreEntry(string line)
            : base(line)
        { }
        private Dictionary<string, string> dictData;
        protected override void ParseLineData(string line)
        {
             // 11:30 red:5  blue:0

            string data = line.Substring(line.IndexOf(":") + 3).Trim();
            string[] dataAry = data.Replace("  ", "|").Split('|');

            dictData = new Dictionary<string, string>(2);

            foreach (var dt in dataAry)
            {
                dictData.Add(dt.Split(':')[0], dt.Split(':')[1]);
            }
        }

        public string TeamRedScore { get { return dictData["red"]; } }
        public string TeamBlueScore { get { return dictData["blue"]; } }

    }
}
